home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
PC
/
MISCBAS
/
BLKJK.ASC
< prev
next >
Wrap
Text File
|
1987-01-11
|
6KB
|
235 lines
1000 DIM C(52),V$(10)
1010 INPUT "INSTRUCTIONS ";I$
1030 IF LEFT$(I$,1)="Y" THEN 3310
1040 C=0
1050 FOR K=0 TO 3
1060 FOR J=1 TO 10
1070 C(J+10*K)=J
1080 NEXTJ:NEXT K
1100 FOR J=41 TO 52:C(J)=10:NEXT J
1130 V$(1)=" A"
1140 V$(2)=" 2"
1150 V$(3)=" 3"
1160 V$(4)=" 4"
1170 V$(5)=" 5"
1180 V$(6)=" 6"
1190 V$(7)=" 7"
1200 V$(8)=" 8"
1210 V$(9)=" 9"
1220 V$(10)="10"
1230 L=40
1250 IF L<40 THEN 1340
1260 FOR J=1 TO 52
1270 Z=C(J)
1280 R=INT(RND(J)*52+1)
1290 C(J)=C(R)
1300 C(R)=Z
1310 NEXT J
1320 L=1
1330 PRINT "NEW DECK":PRINT
1340 T=0
1350 T1=0
1360 S=0
1370 S1=0
1380 INPUT"BET = ";B
1400 IF B=0 THEN 1260
1410 IF B>500 THEN 1380
1420 IF B<1 THEN 1380
1425 IF B<> INT(B) THEN 1380
1430 GOSUB 2940
1440 GOSUB 3090
1450 PRINT " ";V$(C(L-1))
1460 GOSUB 2940
1470 GOSUB 3090
1480 H=C(L-1)
1490 IF C(L-3)=1 THEN 2820
1500 IF T=21 THEN 2690
1510 IF T1=21 THEN 2770
1520 INPUT D$
1530 IF LEFT$(D$,1)="G" THEN 2400
1540 IF LEFT$(D$,1)="D" THEN 2370
1550 IF LEFT$(D$,1)="H" THEN 2270
1560 IF LEFT$(D$,1)="S" THEN 1590
1570 PRINT" RETYPE: ";
1580 GOTO 1520
1590 IF C(L-2)<>C(L-4) THEN 1570
1600 PRINT"FIRST HAND"
1610 B1=B
1620 PRINT V$(C(L-2))
1630 X=C(L-2)
1640 T1=X
1650 GOSUB 2940
1660 IF X<>1 THEN 1690
1670 T1=T1+10
1680 GOTO 1900
1690 INPUT D1$
1700 IF LEFT$(D1$,1)="G" THEN 1900
1710 IF LEFT$(D1$,1)="D" THEN 1870
1720 IF LEFT$(D1$,1)="H" THEN 1750
1730 PRINT" RETYPE: ";:GOTO 1690
1750 GOSUB 2940
1760 IF T1>0 THEN 1820
1770 X1=0
1780 C=C-B1
1790 B1=0
1800 PRINT"BUST"
1810 GOTO 1920
1820 INPUT D1$
1830 IF LEFT$(D1$,1)="G" THEN 1900
1840 IF LEFT$(D1$,1)="H" THEN 1750
1850 PRINT" RETYPE: ";:GOTO 1820
1870 B1=2*B
1880 GOSUB 2940
1890 IF T1=0 THEN 1770
1900 PRINT:PRINT T1
1910 X1=T1
1920 PRINT"SECOND HAND"
1930 B2=B
1940 PRINTV$(X)
1950 T1=X
1960 GOSUB 2940
1970 IFX<>1 THEN 2000
1980 T1=T1+10
1990 GOTO 2230
2000 INPUT D1$
2010 IF LEFT$(D1$,1)="G"THEN 2230
2020 IF LEFT$(D1$,1)="D" THEN 2200
2030 IF LEFT$(D1$,1)="H" THEN 2060
2040 PRINT " RETYPE: ";:GOTO 2000
2060 GOSUB 2940
2070 IF T1>0 THEN 2150
2080 X2=0
2090 C=C-B2
2100 B2=0
2110 PRINT"BUST";
2120 IF X1>0 THEN 2410
2130 PRINT " ";V$(H)
2140 GOTO 2510
2150 INPUT D1$
2160 IF LEFT$(D1$,1)="G" THEN 2230
2170 IF LEFT$(D1$,1)="H"THEN 2060
2180 PRINT " RETYPE: ";:GOTO 2150
2190 B2=2*B
2200 GOSUB 2940
2210 IF T1=0 THEN 2080
2230 PRINT:PRINTT1
2240 B=B1+B2
2250 X2=T1
2260 GOTO 2410
2270 GOSUB 2940
2280 IF T1>0 THEN 2320
2290 PRINT"BUST";
2300 PRINT" ";V$(H)
2310 GOTO 2560
2320 INPUT D$
2330 IF LEFT$(D$,1)="G" THEN 2400
2340 IF LEFT$(D$,1)="H" THEN 2270
2350 PRINT " RETYPE: ";:GOTO 2320
2370 B=2*B
2380 GOSUB 2940
2390 IF T1=0 THEN 2290
2400 PRINT:PRINTT1;
2410 PRINT" ";V$(H);
2420 GOTO 2450
2430 GOSUB 3090
2440 PRINT" ";V$(C(L-1));
2450 IF T<17 THEN 2430
2460 IF T>21 THEN 2490
2470 PRINT":";T
2480 GOTO 2530
2490 PRINT": BUST"
2500 C=C+B
2510 PRINT"YOU HAVE $";C
2520 GOTO 1250
2530 IF LEFT$(D$,1)="S" THEN 2580
2540 IF T1>T THEN 2500
2550 IF T1=T THEN 2510
2560 B=-B
2570 GOTO 2500
2580 IF T>X1 THEN 2670
2590 IF T=X1 THEN 2610
2600 C=C+B1
2610 IF T>X2 THEN 2650
2620 IF T=X2 THEN 2510
2630 C=C+B2
2640 GOTO 2510
2650 C=C-B2
2660 GOTO 2510
2670 C=C-B1
2680 GOTO 2610
2690 IF T1=21 THEN 2740
2700 C=C-B
2710 PRINT" ";V$(H);
2720 PRINT" BLACKJACK"
2730 GOTO 2510
2740 PRINT"BLACKJACK"
2750 PRINT " ";
2760 GOTO 2710
2770 PRINT"BLACKJACK"
2780 PRINT" ";V$(H);
2790 PRINT
2800 C=C+1.5*B
2810 GOTO 2510
2820 INPUT" INSURANCE ";I$
2840 IF LEFT$(I$,1)="Y" THEN 2870
2850 PRINT " ";
2860 GOTO 1500
2870 IF T=21 THEN 2900
2880 C=C-.5*B
2890 GOTO 2850
2900 PRINT " 10";
2910 IF T1<>21 THEN 2720
2920 C=C+B
2930 GOTO 2720
2940 IF T1>10 THEN 2980
2950 IF C(L)<>1 THEN 2980
2960 T1=T1+10
2970 S1=1
2980 T1=T1+C(L)
2990 PRINT V$(C(L));" ";
3000 L=L+1
3010 IF T1<=21 THEN 3080
3020 IF S1=0 THEN 3060
3030 T1=T1-10
3040 S1=0
3050 GOTO 3080
3060 T1=0
3070 PRINT
3080 RETURN
3090 IF T>10 THEN 3130
3100 IF C(L)<>1 THEN 3130
3110 T=T+10
3120 S=1
3130 T=T+C(L)
3140 L=L+1
3150 IF T<=21 THEN 3190
3160 IF S=0 THEN 3190
3170 T=T-10
3180 S=0
3190 RETURN
3310 PRINT"THIS BLACKJACK PROGRAM ENABLES THE OPERATOR TO PLAY HEAD-"
3320 PRINT"TO-HEAD WITH THE COMPUTER, SIMULATING THE EXACT RULES AS"
3330 PRINT"THOSE ON THE LAS VAGES STRIP. THE CARDS ARE DEALT FROM ONE"
3340 PRINT"52-CARD DECK UNTIL A HAND STARTS WITH LESS THAN 12 CARDS"
3350 PRINT"REMAINING IN WHICH CASE IT RESHUFFLES. THE DEALER MUST HIT"
3360 PRINT"THROUGH A TOTAL OF 16 AND STAND ON ALL TOTALS OF 17 AND ABOVE"
3365 INPUT"TYPE A NUMBER THEN (RETURN) TO GO ON";W9
3370 PRINT:PRINT"THE INSURANCE BET IS OFFERED AT HALF THE PLAYERS BET WHEN"
3380 PRINT"THE DEALER'S UP-CARD IS AN ACE."
3390 PRINT"YOU MAY DOUBLE-DOWN ON ANY TWO CARDS, AND RECIEVE ONE MORE"
3395 PRINT"CARD WHILE THE ORIGINAL BET IS DOUBLED"
3400 PRINT"YOU MAY SPLIT ANY HAND BUT RESPLITTING IS NOT ALLOWED."
3410 PRINT"ALSO, ONLY ONE CARD IS DELT ON EACH OF A PAIR OF ACES."
3415 PRINT"YOUR CARDS APPEAR IN THE FAR LEFT COLUMN; THE DEALER ON THE"
3420 PRINT"FAR RIGHT. "
3430 PRINT" THE COMMANDS ARE AS FOLLOWS:"
3440 PRINT" HIT (DRAW ANOTHER CARD)"
3450 PRINT" GOOD (STAND ON CURRENT TOTAL)"
3460 PRINT" DOUBLE (DOUBLE YOUR BET AND DRAW ONE CARD)"
3470 PRINT" SPLIT (FORM TWO HANDS FROM A PAIR WITH THE ORIGINAL"
3480 PRINT" BET ON EACH HAND)"
3490 PRINT:PRINT"COMMANDS MAY BE TYPED IN AS THE FIRST LETTER":PRINT"GOOD LUCK"
3500 GOTO 1040